import request from '../../utils/request.js'

export default function useLoginApi() {
	return {
		signIn: (data) => {
			return request({
				url: '/api/_account/loginjwt',
				method: 'post',
				data,
			});
		},
		refreshToken: () => {
			return request({
				url: '/api/_account/RefreshToken',
				method: 'post'
			});
		},
		signInSSO: (remoteToken) => {
			return request({
				url: '/api/_account/loginjwt?_remotetoken=' + remoteToken,
				method: 'post',
				data: {
					Account: '',
					Password: '',
					RemoteToken: remoteToken
				},
			});
		},	
		signOut: (data) => {
			return request({
				url: '/user/signOut',
				method: 'post',
				data,
			});
		},
		changePassword: (data) => {
			return request({
				url: '/api/_account/ChangePassword',
				method: 'post',
				data,
			});
		},
		getUserInfo: () => {
			return request({
				url: '/api/_account/checkuserinfo',
				method: 'get'
			});
		},
		getTimeLine: (flowname, entitytype, entityid) => {
			return request({
				url: '/_workflowapi/gettimeline',
				method: 'get',
				params: { flowname, entitytype, entityid }
			});
		}
	};
}
